package com.ruike.alisurface.ui.adapters;

import android.content.Context;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.ruike.alisurface.R;
import com.ruike.alisurface.bean.MedicineBean;
import com.voodoo.lib_utils.imageLoader.GlideImageLoader;

import java.util.List;

public class CallProductAdapter extends BaseQuickAdapter<MedicineBean.DataBean.OrderDetailsBean, BaseViewHolder> {


    Context mContext;

    public CallProductAdapter(@Nullable List<MedicineBean.DataBean.OrderDetailsBean> data, Context context) {
        super(R.layout.item_call_product, data);
        mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, MedicineBean.DataBean.OrderDetailsBean item) {
        GlideImageLoader.getInstance().loadImage(mContext, item.getProductImg(), helper.getView(R.id.productimg_img));
        helper.setText(R.id.productname_tv, item.getProductName());
        helper.setText(R.id.manufacturer_tv, item.getManufacturer());
        helper.setText(R.id.price_tv, "￥ " + item.getPrice() + "");
        helper.setText(R.id.count_tv, "x " + item.getQuantity());

    }
}

